/**
 * 
 */
package de.eridea.learning.java.usermanagement.logic.to;

import java.util.Set;

/**
 * @author frank
 * 
 */
public class UserDataImpl implements UserData, UserDataEditable, UserDataLinked {

	private final String loginName;
	private final Set<GroupData> groups;
	private final Set<GroupData> ownedGroups;
	private final Set<ResourceData> ownedResources;
	private String displayName;

	public UserDataImpl(String loginName, Set<GroupData> groups,
			Set<GroupData> ownedGroups, Set<ResourceData> ownedResources) {
		this.loginName = loginName;
		this.groups = groups;
		this.ownedGroups = ownedGroups;
		this.ownedResources = ownedResources;
	}

	public UserDataImpl(String loginName) {
		this.loginName = loginName;
		this.groups = null;
		this.ownedGroups = null;
		this.ownedResources = null;
	}

	public String getLoginName() {
		return loginName;
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see de.eridea.learning.java.usermanagement.logic.to.UserData#getGroups()
	 */
	public Set<GroupData> getGroups() {
		return groups;
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see
	 * de.eridea.learning.java.usermanagement.logic.to.UserData#getOwnedGroups()
	 */
	public Set<GroupData> getOwnedGroups() {
		return ownedGroups;
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see
	 * de.eridea.learning.java.usermanagement.logic.to.UserData#getOwnedResources
	 * ()
	 */
	public Set<ResourceData> getOwnedResources() {
		return ownedResources;
	}

	public String getDisplayName() {
		return displayName;
	}

	public void setDisplayName(String displayName) {
		this.displayName = displayName;
	}

}
